1 /* 2 3 Boost Software License - Version 1.0 - August 17th, 2003 4 5 Permission is hereby granted, free of charge, to any person or organization 6 obtaining a copy of the software and accompanying documentation covered by 7 this license (the "Software") to use, reproduce, display, distribute, 8 execute, and transmit the Software, and to prepare derivative works of the 9 Software, and to permit third-parties to whom the Software is furnished to 10 do so, all subject to the following: 11 12 The copyright notices in the Software and this entire statement, including 13 the above license grant, this restriction and the following disclaimer, 14 must be included in all copies of the Software, in whole or in part, and 15 all derivative works of the Software, unless such copies or derivative 16 works are solely in the form of machine-executable object code generated by 17 a source language processor. 18 19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 22 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 23 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 DEALINGS IN THE SOFTWARE. 26 27 */ 28 29 module derelict.glib.gbytes; 30 31 import derelict.glib.gtypes; 32 import derelict.glib.glibconfig; 33 import derelict.glib.garray; 34 import core.stdc.config; 35 36 extern (C): 37 38 version(Derelict_Link_Static) 39 { 40 extern( C ) nothrow 41 { 42 GBytes* g_bytes_new(gconstpointer data, gsize size); 43 GBytes* g_bytes_new_take(gpointer data, gsize size); 44 GBytes* g_bytes_new_static(gconstpointer data, gsize size); 45 GBytes* g_bytes_new_with_free_func(gconstpointer data, gsize size, GDestroyNotify free_func, gpointer user_data); 46 GBytes* g_bytes_new_from_bytes(GBytes* bytes, gsize offset, gsize length); 47 gconstpointer g_bytes_get_data(GBytes* bytes, gsize* size); 48 gsize g_bytes_get_size(GBytes* bytes); 49 GBytes* g_bytes_ref(GBytes* bytes); 50 void g_bytes_unref(GBytes* bytes); 51 gpointer g_bytes_unref_to_data(GBytes* bytes, gsize* size); 52 GByteArray* g_bytes_unref_to_array(GBytes* bytes); 53 guint g_bytes_hash(gconstpointer bytes); 54 gboolean g_bytes_equal(gconstpointer bytes1, gconstpointer bytes2); 55 gint g_bytes_compare(gconstpointer bytes1, gconstpointer bytes2); 56 } 57 } 58 else 59 { 60 extern( C ) nothrow 61 { 62 alias da_g_bytes_new = GBytes* function(gconstpointer data, gsize size); 63 alias da_g_bytes_new_take = GBytes* function(gpointer data, gsize size); 64 alias da_g_bytes_new_static = GBytes* function(gconstpointer data, gsize size); 65 alias da_g_bytes_new_with_free_func = GBytes* function(gconstpointer data, gsize size, GDestroyNotify free_func, gpointer user_data); 66 alias da_g_bytes_new_from_bytes = GBytes* function(GBytes* bytes, gsize offset, gsize length); 67 alias da_g_bytes_get_data = gconstpointer function(GBytes* bytes, gsize* size); 68 alias da_g_bytes_get_size = gsize function(GBytes* bytes); 69 alias da_g_bytes_ref = GBytes* function(GBytes* bytes); 70 alias da_g_bytes_unref = void function(GBytes* bytes); 71 alias da_g_bytes_unref_to_data = gpointer function(GBytes* bytes, gsize* size); 72 alias da_g_bytes_unref_to_array = GByteArray* function(GBytes* bytes); 73 alias da_g_bytes_hash = guint function(gconstpointer bytes); 74 alias da_g_bytes_equal = gboolean function(gconstpointer bytes1, gconstpointer bytes2); 75 alias da_g_bytes_compare = gint function(gconstpointer bytes1, gconstpointer bytes2); 76 } 77 78 __gshared 79 { 80 da_g_bytes_new g_bytes_new; 81 da_g_bytes_new_take g_bytes_new_take; 82 da_g_bytes_new_static g_bytes_new_static; 83 da_g_bytes_new_with_free_func g_bytes_new_with_free_func; 84 da_g_bytes_new_from_bytes g_bytes_new_from_bytes; 85 da_g_bytes_get_data g_bytes_get_data; 86 da_g_bytes_get_size g_bytes_get_size; 87 da_g_bytes_ref g_bytes_ref; 88 da_g_bytes_unref g_bytes_unref; 89 da_g_bytes_unref_to_data g_bytes_unref_to_data; 90 da_g_bytes_unref_to_array g_bytes_unref_to_array; 91 da_g_bytes_hash g_bytes_hash; 92 da_g_bytes_equal g_bytes_equal; 93 da_g_bytes_compare g_bytes_compare; 94 } 95 }